﻿@{
    var requirementsMessage = T.Plural("The password can't be empty", "Passwords are required to be a minimum of {0} characters in length", (int)ViewData["PasswordLength"]).Text;
    var additionalRequirementsMessage = new List<string>();
    if ((bool)ViewData["LowercaseRequirement"]) {
        additionalRequirementsMessage.Add(T("one lowercase letter").Text);
    }
    if ((bool)ViewData["UppercaseRequirement"]) {
        additionalRequirementsMessage.Add(T("one uppercase letter").Text);
    }
    if ((bool)ViewData["NumberRequirement"]) {
        additionalRequirementsMessage.Add(T("one number").Text);
    }
    if ((bool)ViewData["SpecialCharacterRequirement"]) {
        additionalRequirementsMessage.Add(T("one special character").Text);
    }
    if (additionalRequirementsMessage.Count() > 0) {
        requirementsMessage = T("{0} and must contain at least {1}", requirementsMessage, string.Join(", ", additionalRequirementsMessage)).Text;
    }
    requirementsMessage += ".";
}
<h1>@Html.TitleForPage(T("Create a New Account").ToString())</h1>
<p>@T("Use the form below to create a new account.")</p>
<p>@requirementsMessage</p>
@Html.ValidationSummary(T("Account creation was unsuccessful. Please correct the errors and try again.").ToString())
@using (Html.BeginFormAntiForgeryPost(Url.Action("Register", new { ReturnUrl = Request.QueryString["ReturnUrl"] }))) {
    <fieldset>
        <legend>@T("Account Information")</legend>
        <div>
            <label for="username">@T("Username:")</label>
            @Html.TextBox("username")
            @Html.ValidationMessage("username")
        </div>
        <div>
            <label for="email">@T("Email:")</label>
            @Html.TextBox("email")
            @Html.ValidationMessage("email")
        </div>
        <div>
            <label for="password">@T("Password:")</label>
            @Html.Password("password")
            @Html.ValidationMessage("password")
        </div>
        <div>
            <label for="confirmPassword">@T("Confirm password:")</label>
            @Html.Password("confirmPassword")
            @Html.ValidationMessage("confirmPassword")
        </div>
        <div>
            <button class="primaryAction" type="submit">@T("Register")</button>
        </div>
    </fieldset>
} 